package com.yangwp.jie.service.impl;

import com.yangwp.jie.dao.JieArticleDao;
import com.yangwp.jie.model.JieArticle;
import com.yangwp.jie.service.JieArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JieArticleServiceImpl implements JieArticleService {

    @Autowired
    private JieArticleDao jieArticleDao;

    @Override
    public List<JieArticle> getContents(){
        try {
            return jieArticleDao.getContentList(null);
        }catch (Exception e){
        }
        return null;
    }

    @Override
    public Boolean save(JieArticle jieArticle){
        try {
            jieArticle.setUserId(0);
            return jieArticleDao.insert(jieArticle) > 0;
        }catch (Exception e){
            System.out.println(e);
        }
        return Boolean.FALSE;
    }

}
